<?php
  $URL = $app->ConnURL;
  
  $dbConfig['DB_TYPE'] = substr($URL, 0, strpos($URL, '://'));
  $URL = str_replace($dbConfig['DB_TYPE'] . '://', '', $URL);
  $dbConfig['DB_USERNAME'] = substr($URL, 0, strpos($URL, ':'));
  $URL = str_replace($dbConfig['DB_USERNAME'] . ':', '', $URL);
  $dbConfig['DB_PASSWORD'] = substr($URL, 0, strpos($URL, '@'));
  $URL = str_replace($dbConfig['DB_PASSWORD'] . '@', '', $URL);
  if (strpos($URL, '/') != false) {
    $dbConfig['DB_HOST'] = substr($URL, 0, strpos($URL, '/'));
    $URL = str_replace($dbConfig['DB_HOST'] . '/', '', $URL);
    $dbConfig['DB_DATABASE_NAME'] = trim($URL);
  } else {
    $dbConfig['DB_HOST'] = trim($URL);
    $dbConfig['DB_DATABASE_NAME'] = '';
  }
?>
